<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	请输入城市：<input type="text" id="city">
</body>
</html>
<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script>
	$('#city').blur(function(){
		var city = $(this).val();
		$.ajax({
			url:"demo.php",
			data:{city:city},
			datatype:"json",
			type:"post",
				success:function(res){
					console.log(res)
				}
		});
	});
</script>